﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace JumpstartApp.Models
{
    [XmlRoot(ElementName = "Course")]
    public class CourseRecord: ParentBase
    {
        private string m_Date = string.Empty;
        [XmlElement("Date")]
        public string Date
        {
            get
            {
                DateTime _Date;
                if (DateTime.TryParse(m_Date, out _Date))
                    return _Date.ToString("MMMM dd, yyyy");
                return m_Date;
            }
            set { m_Date = value; }
        }
        public DateTime DateTime
        {
            get
            {
                DateTime _Date;
                if (DateTime.TryParse(m_Date, out _Date))
                    return _Date;
                return DateTime.MinValue;
            }
        }
    }
}
